using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for BasePage
/// </summary>
public class BasePage : System.Web.UI.Page
{
    public BasePage()
    {
        //
        // TODO: Add constructor logic here
        //
    }


    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);

        if (!Page.User.Identity.IsAuthenticated)
        {
            FormsAuthentication.RedirectToLoginPage();
        }
    }

    protected override void OnPreInit(EventArgs e)
    {
        base.OnPreInit(e);
        if (SessionHandler.SelectedTheme == null)
        {
            SessionHandler.SelectedTheme = "Default";
            Page.Theme = ((string)SessionHandler.SelectedTheme);
        }
        else
        {
            Page.Theme = ((string)SessionHandler.SelectedTheme);
        }

        this.MaintainScrollPositionOnPostBack = true;
    }
}
